package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.webkit.WebView;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

          WebView webView= findViewById(R.id.webview);
//        webView.loadUrl("https://www.baidu.com");
//        webView.getSettings().setSupportZoom(true);
//        webView.getSettings().setBuiltInZoomControls(true);
        //创建字符串构建器
          StringBuilder stringBuilder = new StringBuilder();
          stringBuilder.append("<div>使用Android创建HTML页面</div>");
          stringBuilder.append("<br/>");
        stringBuilder.append("<h1>舒强健</h1>");
        stringBuilder.append("<h3>201965110466</h3>");
          webView.loadDataWithBaseURL(null,stringBuilder.toString(),"text/html","utf-8",null);
    }
}












